package com.gu.untils;

import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;

/**
 * Description: 生成订单随机号
 *
 * @Autor: Rolin
 * datetime: 06-20-14:52
 */

public class CreateOrderNo {

    public static String create(){
        String uuid = UUID.randomUUID().toString();
        String[] splits = uuid.split("-");
        String result = "";
        for (String split : splits) {
            result += split;
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
        String date = sdf.format(new Date());
        String orderNo = result + "_" + date;
        return orderNo ;
    }
}
